package com.fastCms.business.bim.manage.impl;

import com.fastCms.business.bim.daos.DynamicMapper;
import com.fastCms.business.bim.manage.DynamicManageService;
import com.fastCms.business.bim.pojo.vo.DynamicVO;
import com.fastCms.business.frame.pojo.PageParam;
import com.fastCms.business.friend.pojo.po.DynamicPO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class DynamicManageServiceImpl implements DynamicManageService {
    @Resource
    private DynamicMapper dynamicMapper;

    @Override
    public PageInfo<DynamicVO> showPage(PageParam<DynamicPO> param) {
        PageInfo<DynamicVO> pageResult = PageHelper.startPage(param.getPageNum(), param.getPageSize())
            .doSelectPageInfo(() ->
                dynamicMapper.showList(param.getQueryFields())
            );
        return pageResult;
    }
}

